package org.jeecg.modules.golf.question.client;

import lombok.Data;
import org.jeecg.modules.golf.question.entity.QuestionType;

import java.util.Arrays;
import java.util.List;
import java.util.Set;

/**
 * @author jiguansheng
 * @date 2020/11/11
 * 问题分类分析
 **/
@Data
public class QuestionTypeAnalysisDTO {


    private String questionTypeId;
    /**
     * 节点树id
     */
    private String treePath;
    /**
     * 节点树文本
     */
    private String treePathStr;
    /**
     * 父节点id
     */
    private String parentId;


    private List<String> questionTypeIdList;

    private Integer questionCount ;

    private Integer traineeCount;

    private transient Set<String> traineeList ;



    public Integer traineeCount(){
        return traineeList.size();
    }

    /**
     * 节点深度
     */
    private Integer deep;
    public QuestionTypeAnalysisDTO(){

    }

    public QuestionTypeAnalysisDTO(QuestionType questionType){
        this.questionTypeId = questionType.getId();
        this.treePath = questionType.getTreePath();
        this.questionTypeIdList = Arrays.asList(treePath.split(","));
        this.parentId = questionType.getParentId();
        this.deep = questionType.getDeep();
    }

}
